package com.baseframe.sms.sign;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public enum SmsPattern {

    UNKNOWN(0,"未知"),

    UNI_SMS(1,"{}"),

    TENCENT(2,"{}")

    ;

    private final int code;

    private final String pattern;

    public static String getPattern(Integer code){
        for (SmsPattern value : values()) {
            if (value.code == code){
                return value.pattern;
            }
        }

        return UNKNOWN.pattern;
    }

    public static String getPattern(SmsPattern smsPattern){
        for (SmsPattern value : values()) {
            if (value == smsPattern){
                return value.pattern;
            }
        }

        return UNKNOWN.pattern;
    }
}
